geneAnnot <- txs()
source("https://bioconductor.org/biocLite.R")
biocLite("Homo.sapiens")
> library(oligoClasses)
Welcome to oligoClasses version 1.38.0
> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 8 (jessie)
> library(oligoClasses)
No methods found in "RSQLite" for requests: dbGetQuery
Welcome to oligoClasses version 1.39.0
> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 8 (jessie)
library(oligoClasses)
Welcome to oligoClasses version 1.38.0
sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 8 (jessie)
library(oligoClasses)
No methods found in "RSQLite" for requests: dbGetQuery
Welcome to oligoClasses version 1.39.0
sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 8 (jessie)
source("https://bioconductor.org/biocLite.R")
biocLite("Homo.sapiens")
installing help indices
install.packages('RSQLite')
install.packages("RSQLite")
source("https://bioconductor.org/biocLite.R")
biocLite("Homo.sapiens")
library('RSQLite')
source("https://bioconductor.org/biocLite.R")
biocLite("Homo.sapiens")
source("https://bioconductor.org/biocLite.R")
biocLite("DBI")
source("https://bioconductor.org/biocLite.R")
biocLite("Homo.sapiens")
library('DBI')
source("https://bioconductor.org/biocLite.R")
biocLite("Homo.sapiens")
source("https://bioconductor.org/biocLite.R")
biocLite("Homo.sapiens")
library(DBI)
mydb <- dbConnect(RSQLite::SQLite(), "my-db.sqlite")
dbDisconnect(mydb)
unlink("my-db.sqlite")
mydb <- dbConnect(RSQLite::SQLite(), "")
dbDisconnect(mydb)
mydb <- dbConnect(RSQLite::SQLite(), "")
dbWriteTable(mydb, "mtcars", mtcars)
dbWriteTable(mydb, "iris", iris)
dbListTables(mydb)
dbGetQuery(mydb, 'SELECT * FROM mtcars LIMIT 5')
biocLite("Homo.sapiens")
biocLite("RSQLite")
library('RSQLite')
biocLite("Homo.sapiens")
library('homo.sapiens')
library("Homo.sapiens")
biocLite("ELMER")
geneAnnot <- txs()
library('ELMER')
library('Homo.sapiens')
geneAnnot <- txs()
uri <- 'http://www.uniprot.org/uniprot/?query='
geneAnnot <- txs()
geneAnnot <- GRanges()
geneAnnot$GENEID <- paste0("ID",geneAnnot$GENEID)
geneInfo <- promoters(geneAnnot,upstream = 0, downstream = 0)
probe <- get.feature.probe()
mee <- fetch.mee(meth = luad.met, exp = luad.exp, TCGA = TRUE,
probeInfo = probe, geneInfo = geneInfo)
head(geneAnnot)
geneAnnot <- txs()
geneAnnot <- tsx()
install.packages('ELMER')
install.packages("ELMER")
install.packages("ELMER")
install.packages("ELMER")
install.packages("Homo.sapiens")
source("http://bioconductor.org/biocLite.R")
?
biocLite
biocLite('Homo.sapiens')
biocLite('RSQLite')
library('RSQLite')
biocLite('Homo.sapiens')
cls <- columns(Homo.sapiens)
res <- select(Homo.sapiens, keys=ks, columns=cls, keytype=kt)
biocLite('TxDb.Hsapiens.UCSC.hg19.knownGene')
library('ELMER')
geneAnnot <- txs()
library(parallel)
geneAnnot <- txs()
biocLite('ELMER')
biocLite("ELMER")
biocLite("ELMER")
biocLite("ELMER")
biocLite("Homo.sapiens")
biocLite("ELMER",lip.path='/private/var/folders/_t/6q8tmd456kq5dc1fcsr0p5rr0000gp/T')
biocLite("ELMER",lip.path='/private/var/')
library("Bioc2017.TCGAbiolinks.ELMER")
install.packages('Bioc2017.TCGAbiolinks.ELMER')
library(TCGAbiolinks)
library(SummarizedExperiment)
library(DT)
library(dplyr)
source("https://bioconductor.org/biocLite.R")
biocLite("DT")
biocLite("dplyr")
query.exp <- GDCquery(project = "TCGA-LUSC",
data.category = "Transcriptome Profiling",
data.type = "Gene Expression Quantification",
workflow.type = "HTSeq - FPKM-UQ",
barcode = c("TCGA-34-5231-01","TCGA-77-7138-01"))
GDCdownload(query.exp)
exp <- GDCprepare(query = query.exp,
save = TRUE,
save.filename = "Exp_LUSC.rda",
summarizedExperiment = TRUE)
query.met <- GDCquery(project = "TCGA-LUSC",
data.category = "DNA Methylation",
platform = "Illumina Human Methylation 450",
barcode = c("TCGA-34-5231-01A-21D-1818-05","TCGA-77-7138-01A-41D-2043-05"))
GDCdownload(query.met)
met <- GDCprepare(query = query.met,
save = TRUE,
save.filename = "DNAmethylation_LUSC.rda",
summarizedExperiment = TRUE)
library(MultiAssayExperiment)
library(ELMER)
lusc.exp
lusc.met
distal.probes <- get.feature.probe(genome = "hg38", met.platform = "450K")
mae <- createMAE(exp = lusc.exp,
met = lusc.met,
save = TRUE,
linearize.exp = TRUE,
filter.probes = distal.probes,
save.filename = "mae_bioc2017.rda",
met.platform = "450K",
genome = "hg19",
TCGA = TRUE)
lusc.exp<- TCGAprepare_elmer(met,
platform = "HumanMethylation450",
save = TRUE,
met.na.cut = 0.2)
luad.met <- TCGAprepare_elmer(exp,
save = TRUE,
platform = "IlluminaHiSeq_RNASeqV2")
luad.exp<- TCGAprepare_elmer(exp,
save = TRUE,
platform = "IlluminaHiSeq_RNASeqV2")
lusc.met<- TCGAprepare_elmer(met,
platform = "HumanMethylation450",
save = TRUE,
met.na.cut = 0.2)
distal.probes <- get.feature.probe(genome = "hg38", met.platform = "450K")
mae <- createMAE(exp = lusc.exp,
met = lusc.met,
save = TRUE,
linearize.exp = TRUE,
filter.probes = distal.probes,
save.filename = "mae_bioc2017.rda",
met.platform = "450K",
genome = "hg19",
TCGA = TRUE)
colData(mae)[1:5,] %>%  as.data.frame %>% datatable(options = list(scrollX = TRUE))
sampleMap(mae)[1:5,] %>%  as.data.frame %>% datatable(options = list(scrollX = TRUE))
head(mae)
mae <- createMAE(exp = lusc.exp,
met = lusc.met,
save = TRUE,
linearize.exp = TRUE,
filter.probes = distal.probes,
save.filename = "mae_bioc2017.rda",
met.platform = "450K",
genome = "hg19",
TCGA = TRUE)
library(ELMER)
library(parallel)
geneAnnot <- txs()
remove('ELMER')
remove('ELMER',lib='.../downloads')
remove('ELMER',lib='.../downloads')
remove('rms')
remove('ggplot2')
library(ELMER)
library(parallel)
geneAnnot <- txs()
probe <- get.feature.probe()
library(parallel)
probe <- get.feature.probe()
library(ELMER)
probe <- get.feature.probe()
library(Homo.sapiens)
library(IlluminaHumanMethylation450kanno.ilmn12.hg19)
probe <- get.feature.probe()
library(IlluminaHumanMethylation450kanno.ilmn12.hg19)
library(Homo.sapiens)
probe <- get.feature.probe()
library(ELMER)
probe <- get.feature.probe()
geneAnnot <- txs()
head(geneAnnot)
write(geneAnnot,file='geneAnnot.csv')
probe <- get.feature.probe()
remove.packages('ELMER')
probe <- get.feature.probe()\
probe <- get.feature.probe()
q()
setwd("/Users/brian/Desktop/1survivalsignature/result/Training/TCGA")
sig<-read.csv("13coef.csv",header = T,sep = ',')
sig
clin<-read.csv("clin.csv",he)
clin<-read.csv("clin.csv",header = T,sep = ",")
clin[1:5,1:5]
exp<-read.table("gene.exprsfoldchange.exprs.FDR0.05.txt",header = T,sep = "\t",quote = "")
exp[1:5,1:5]
eset<-exp[,-1]
rownames(eset)<-exp$genesymbol
eset[1:5,1:5]
dim(eset1)
dim(eset)
dim(clin)
loc<-match(sig$X,rownames(eset))
loc
eset<-read.csv("exp.csv",header = T,sep = ",")
eset[1:5,1:5]
eset1<-eset[,-1]
rownames(eset1)<-eset$X
eset1[1:5,1:5]
loc<-match(sig$X,rownames(eset1))
loc
dim(eset1)
eset2<-eset1[loc,]
dim(eset2)
write.csv(eset2,"13coef_exp.csv")
eset2[1:5,1:5]
dim(eset2)
sum<-0
sub<-vector()
for(i in 1:351){for(j in 1:13){ dat<-eset2[j,i]*sig[j,2]; sum<-dat+sum};sub[i]<-sum;sum<-0}
sub
library("survivalROC")
Mayo.fit4 <- survivalROC.C( Stime = clin$X_RFS,
status = clin$X_RFS_IND,
marker = sub,
predict.time = 365,
span = 0.25*351^(-0.20))
Staltscore4 <- Mayo.fit4$Survival
plot(Mayo.fit4$FP, Mayo.fit4$TP, type = "l",
xlim = c(0,1), ylim = c(0,1),
xlab = paste( "FP \n AUC =",round(Mayo.fit4$AUC,3)),
ylab = "TP",main = "Year = 1" )
abline(0,1,lty=2)
loc<-match(clin$sampleID,colnames(eset2))
loc
eset3<-eset2[,loc]
write.csv(eset3,"13coef_exp.csv")
dim(eset3)
sum<-0
sub<-vector()
for(i in 1:351){for(j in 1:13){ dat<-eset2[j,i]*sig[j,2]; sum<-dat+sum};sub[i]<-sum;sum<-0}
sub
Mayo.fit4 <- survivalROC.C( Stime = clin$X_RFS,
status = clin$X_RFS_IND,
marker = sub,
predict.time = 365,
span = 0.25*351^(-0.20))
Staltscore4 <- Mayo.fit4$Survival
plot(Mayo.fit4$FP, Mayo.fit4$TP, type = "l",
xlim = c(0,1), ylim = c(0,1),
xlab = paste( "FP \n AUC =",round(Mayo.fit4$AUC,3)),
ylab = "TP",main = "Year = 1" )
abline(0,1,lty=2)
Staltscore4 <- Mayo.fit4$Survival
plot(Mayo.fit4$FP, Mayo.fit4$TP, type = "l",
xlim = c(0,1), ylim = c(0,1),
xlab = paste( "FP \n AUC =",round(Mayo.fit4$AUC,3)),
ylab = "TP",main = "Year = 1" )
abline(0,1,lty=2)
for(i in 1:351){for(j in 1:13){ dat<-eset3[j,i]*sig[j,2]; sum<-dat+sum};sub[i]<-sum;sum<-0}
Mayo.fit4 <- survivalROC.C( Stime = clin$X_RFS,
status = clin$X_RFS_IND,
marker = sub,
predict.time = 365,
span = 0.25*351^(-0.20))
Staltscore4 <- Mayo.fit4$Survival
plot(Mayo.fit4$FP, Mayo.fit4$TP, type = "l",
xlim = c(0,1), ylim = c(0,1),
xlab = paste( "FP \n AUC =",round(Mayo.fit4$AUC,3)),
ylab = "TP",main = "Year = 1" )
abline(0,1,lty=2)
library(survival)
data(pbc)
head(pbc)
pbc<-pbc[!is.na(pbc$trt),] # select only randomised subjects
pbc$status<-as.numeric(pbc$status==2) # create event indicator: 1 for death, 0 for censored
# we evaluate bilirubin as a prognostic biomarker for death.
# 1) with the Kaplan-Meier estimator for computing the weights (default).
ROC.bili.marginal<-timeROC(T=pbc$time,
delta=pbc$status,marker=pbc$bili,
cause=1,weighting="marginal",
times=quantile(pbc$time,probs=seq(0.2,0.8,0.1)),
iid=TRUE)
install.packages("timeROC")
library(timeROC)
pbc<-pbc[!is.na(pbc$trt),] # select only randomised subjects
pbc$status<-as.numeric(pbc$status==2) # create event indicator: 1 for death, 0 for censored
# we evaluate bilirubin as a prognostic biomarker for death.
# 1) with the Kaplan-Meier estimator for computing the weights (default).
ROC.bili.marginal<-timeROC(T=pbc$time,
delta=pbc$status,marker=pbc$bili,
cause=1,weighting="marginal",
times=quantile(pbc$time,probs=seq(0.2,0.8,0.1)),
iid=TRUE)
data(Paquid)
# evaluate DDST cognitive score as a prognostic tool for
# dementia onset, accounting for death without dementia competing risk.
ROC.DSST<-timeROC(T=Paquid$time,delta=Paquid$status,
marker=-Paquid$DSST,cause=1,
weighting="cox",
other_markers=as.matrix(Paquid$MMSE),
times=c(3,5,10),ROC=TRUE)
ROC.DSST
plot(ROC.DSST,time=5)
ROC.albumin<-timeROC(T=pbc$time,
delta=pbc$status,marker=-pbc$albumin,
cause=1,weighting="marginal",
times=quantile(pbc$time,probs=seq(0.2,0.8,0.02)),
iid=TRUE)
ROC.albumin
# plot AUC curve for albumin only with pointwise confidence intervals
# and simultaneous confidence bands
plotAUCcurve(ROC.albumin,conf.int=TRUE,conf.band=TRUE)
# plot AUC curve for albumin and bilirunbin with pointwise confidence intervals
plotAUCcurve(ROC.albumin,conf.int=TRUE,col="red")
plotAUCcurve(ROC.bili,conf.int=TRUE,col="blue",add=TRUE)
legend("bottomright",c("albumin","bilirunbin"),col=c("red","blue"),lty=1,lwd=2)
ROC.thick<-timeROC(T=Melano$time,delta=Melano$status,
marker=Melano$thick,cause=1,
times=quantile(Melano$time,probs=seq(0.2,0.8,0.01)),
iid=TRUE)
data(Melano)
head(Melano)
ROC.thick<-timeROC(T=Melano$time,delta=Melano$status,
marker=Melano$thick,cause=1,
times=quantile(Melano$time,probs=seq(0.2,0.8,0.01)),
iid=TRUE)
plotAUCcurve(ROC.thick,FP=2,conf.int=TRUE,conf.band=TRUE)
ROC.thick<-timeROC(T=clin$X_RFS,delta=clin$X_RFS_IND,
marker=sub,cause=1,
times=quantile(clin$X_RFS,probs=seq(0.2,0.8,0.01)),
iid=TRUE)
plotAUCcurve(ROC.thick,FP=2,conf.int=TRUE,conf.band=TRUE)
plotAUCcurve(ROC.thick,FP=2)
setwd("/Users/brian/Desktop/1survivalsignature/result/validation/GSE50081")
clin<-read.csv("clin.csv",header = T,sep = ",")
dim(clin)
eset<-read.csv("expreforoverlap.csv",header = T,se)
eset<-read.csv("expreforoverlap.csv",header = T,sep = ",")
eset[1:5,1:5]
eset1<-eset[,-1]
rownames(eset1)<-eset$gene
eset1[1:5,1:5]
dim(eset1)
loc<-match(sig$X,rownames(eset1))
loc
sig$X
rownames(eset1)
eset<-read.table("geneid.exprs.txt",header = T,sep = "\t")
loc<-match(sig$
)
loc<-match(sig$X,eset$geneid
)
loc
sig<-read.csv("13coef.csv",header = T,sep = ",")
loc<-match(sig$X,eset$geneid
)
loc
eset1<-eset[loc,]
dim(eset1)
eset2<-eset1[,-1]
rownames(eset2)<-eset1$geneid
eset2[1:5,1:5]
dim(eset2)
loc<-match(clin$X.Sample_geo_accession,colnames(eset2))
loc
eset3<-eset2[,loc]
dim(eset3)
write.csv(eset3,"13coef_exp.csv")
sum<-0
sub<-vector()
for(i in 1:124){for(j in 1:13){ dat<-eset3[j,i]*sig[j,2]; sum<-dat+sum};sub[i]<-sum;sum<-0}
sub
ROC.thick<-timeROC(T=clin$time,delta=clin$status,
marker=sub,cause=1,
times=quantile(clin$time,probs=seq(0.2,0.8,0.01)),
iid=TRUE)
plotAUCcurve(ROC.thick,FP=2,conf.int=TRUE,conf.band=TRUE)
plotAUCcurve(ROC.thick,FP=2)
Mayo.fit4 <- survivalROC.C( Stime = clin$time,
status = clin$status,
marker = sub,
predict.time = 1,
span = 0.25*124^(-0.20))
Staltscore4 <- Mayo.fit4$Survival
plot(Mayo.fit4$FP, Mayo.fit4$TP, type = "l",
xlim = c(0,1), ylim = c(0,1),
xlab = paste( "FP \n AUC =",round(Mayo.fit4$AUC,3)),
ylab = "TP",main = "Year = 1" )
abline(0,1,lty=2)
setwd("/Users/brian/Desktop/1survivalsignature/result/validation/GSE31210")
sig<-read.csv("13coef.csv",he)
sig<-read.csv("13coef.csv",header = T,sep = ",")
sig
eset<-read.csv("exp_13coef.csv",header = T,sep = ",")
dim(eset)
eset[1:5,1:5]
eset1<-eset[,-1]
rownames(eset1)<-eset$X
eset1[1:5,1:5]
clin<-read.csv("clin.csv",he)
clin<-read.csv("clin.csv",header = T,sep = ",")
clin
clin[1:5,1:5]
sum<-0
sub<-vector()
dim(clin)
for(i in 1:162){for(j in 1:13){dat<-eset1(j,i)*sig[j,2];sum<-dat+sum};sub[i]<-sum;sum<-0}
for(i in 1:162){for(j in 1:13){dat<-eset1[j,i]*sig[j,2];sum<-dat+sum};sub[i]<-sum;sum<-0}
sub
ROC.thick<-timeROC(T=clin$time,delta=clin$status,
marker=sub,cause=1,
times=quantile(clin$time,probs=seq(0.2,0.8,0.01)),
iid=TRUE)
plotAUCcurve(ROC.thick,FP=2,conf.int=TRUE,conf.band=TRUE)
loc<-match(clin$X.Sample_geo_accession,colnames(eset1))
loc
Mayo.fit4 <- survivalROC.C( Stime = clin$time,
status = clin$status,
marker = sub,
predict.time = 365,
span = 0.25*162^(-0.20))
Staltscore4 <- Mayo.fit4$Survival
plot(Mayo.fit4$FP, Mayo.fit4$TP, type = "l",
xlim = c(0,1), ylim = c(0,1),
xlab = paste( "FP \n AUC =",round(Mayo.fit4$AUC,3)),
ylab = "TP",main = "Year = 1" )
abline(0,1,lty=2)
Mayo.fit4 <- survivalROC.C( Stime = clin$time,
status = clin$status,
marker = sub,
predict.time = 1500,
span = 0.25*162^(-0.20))
Staltscore4 <- Mayo.fit4$Survival
plot(Mayo.fit4$FP, Mayo.fit4$TP, type = "l",
xlim = c(0,1), ylim = c(0,1),
xlab = paste( "FP \n AUC =",round(Mayo.fit4$AUC,3)),
ylab = "TP",main = "Year = 1" )
abline(0,1,lty=2)
Mayo.fit4 <- survivalROC.C( Stime = clin$time,
status = clin$status,
marker = sub,
predict.time = 2000,
span = 0.25*162^(-0.20))
Staltscore4 <- Mayo.fit4$Survival
plot(Mayo.fit4$FP, Mayo.fit4$TP, type = "l",
xlim = c(0,1), ylim = c(0,1),
xlab = paste( "FP \n AUC =",round(Mayo.fit4$AUC,3)),
ylab = "TP",main = "Year = 1" )
abline(0,1,lty=2)
plotAUCcurve(ROC.thick,FP=2,ylim(0,1))
sub<-read.csv("risk_score.csv",header = T,sep = ",")
Mayo.fit4 <- survivalROC.C( Stime = clin$time,
status = clin$status,
marker = sub,
predict.time = 2000,
span = 0.25*162^(-0.20))
sub
Mayo.fit4 <- survivalROC.C( Stime = clin$time,
status = clin$status,
marker = sub$x,
predict.time = 2000,
span = 0.25*162^(-0.20))
Staltscore4 <- Mayo.fit4$Survival
plot(Mayo.fit4$FP, Mayo.fit4$TP, type = "l",
xlim = c(0,1), ylim = c(0,1),
xlab = paste( "FP \n AUC =",round(Mayo.fit4$AUC,3)),
ylab = "TP",main = "Year = 1" )
abline(0,1,lty=2)
Mayo.fit4 <- survivalROC.C( Stime = sub$time,
status = sub$status,
marker = sub$x,
predict.time = 2000,
span = 0.25*162^(-0.20))
Staltscore4 <- Mayo.fit4$Survival
plot(Mayo.fit4$FP, Mayo.fit4$TP, type = "l",
xlim = c(0,1), ylim = c(0,1),
xlab = paste( "FP \n AUC =",round(Mayo.fit4$AUC,3)),
ylab = "TP",main = "Year = 1" )
abline(0,1,lty=2)
setwd("/Users/brian/Desktop/1survivalsignature/result/validation/GSE41271")
setwd("/Users/brian/Desktop/1survivalsignature/result/validation/GSE37745")
sig<-read.csv("13coef.csv",header = T,sep = ",")
